package com.the4man.framework.model;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lenovo on 2017/12/11.
 */
public class MessageRecordExample {
    protected String orderByClause;
    protected boolean distinct;
    protected List<Criteria> oredCriteria = new ArrayList();

    public MessageRecordExample() {
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return this.orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return this.distinct;
    }

    public List<MessageRecordExample.Criteria> getOredCriteria() {
        return this.oredCriteria;
    }

    public void or(MessageRecordExample.Criteria criteria) {
        this.oredCriteria.add(criteria);
    }

    public MessageRecordExample.Criteria or() {
        MessageRecordExample.Criteria criteria = this.createCriteriaInternal();
        this.oredCriteria.add(criteria);
        return criteria;
    }

    public MessageRecordExample.Criteria createCriteria() {
        MessageRecordExample.Criteria criteria = this.createCriteriaInternal();
        if(this.oredCriteria.size() == 0) {
            this.oredCriteria.add(criteria);
        }

        return criteria;
    }

    protected MessageRecordExample.Criteria createCriteriaInternal() {
        MessageRecordExample.Criteria criteria = new MessageRecordExample.Criteria();
        return criteria;
    }

    public void clear() {
        this.oredCriteria.clear();
        this.orderByClause = null;
        this.distinct = false;
    }

    public static class Criteria extends MessageRecordExample.GeneratedCriteria {
        protected Criteria() {
        }
    }

    public static class Criterion {
        private String condition;
        private Object value;
        private Object secondValue;
        private boolean noValue;
        private boolean singleValue;
        private boolean betweenValue;
        private boolean listValue;
        private String typeHandler;

        public String getCondition() {
            return this.condition;
        }

        public Object getValue() {
            return this.value;
        }

        public Object getSecondValue() {
            return this.secondValue;
        }

        public boolean isNoValue() {
            return this.noValue;
        }

        public boolean isSingleValue() {
            return this.singleValue;
        }

        public boolean isBetweenValue() {
            return this.betweenValue;
        }

        public boolean isListValue() {
            return this.listValue;
        }

        public String getTypeHandler() {
            return this.typeHandler;
        }

        protected Criterion(String condition) {
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if(value instanceof List) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }

        }

        protected Criterion(String condition, Object value) {
            this(condition, value, (String)null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, (String)null);
        }
    }

    protected abstract static class GeneratedCriteria {
        protected List<MessageRecordExample.Criterion> criteria = new ArrayList();

        protected GeneratedCriteria() {
        }

        public boolean isValid() {
            return this.criteria.size() > 0;
        }

        public List<MessageRecordExample.Criterion> getAllCriteria() {
            return this.criteria;
        }

        public List<MessageRecordExample.Criterion> getCriteria() {
            return this.criteria;
        }

        protected void addCriterion(String condition) {
            if(condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            } else {
                this.criteria.add(new MessageRecordExample.Criterion(condition));
            }
        }

        protected void addCriterion(String condition, Object value, String property) {
            if(value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            } else {
                this.criteria.add(new MessageRecordExample.Criterion(condition, value));
            }
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if(value1 != null && value2 != null) {
                this.criteria.add(new MessageRecordExample.Criterion(condition, value1, value2));
            } else {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
        }

        public MessageRecordExample.Criteria andNoOffDate() {
            this.addCriterion("MSG_ID IN (select MSG_ID from MESSAGE where (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(msg_Create_Time)) < (validity*60*60))");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdIsNull() {
            this.addCriterion("RECORD_ID is null");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdIsNotNull() {
            this.addCriterion("RECORD_ID is not null");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdEqualTo(String value) {
            this.addCriterion("RECORD_ID =", value, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdNotEqualTo(String value) {
            this.addCriterion("RECORD_ID <>", value, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdGreaterThan(String value) {
            this.addCriterion("RECORD_ID >", value, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdGreaterThanOrEqualTo(String value) {
            this.addCriterion("RECORD_ID >=", value, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdLessThan(String value) {
            this.addCriterion("RECORD_ID <", value, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdLessThanOrEqualTo(String value) {
            this.addCriterion("RECORD_ID <=", value, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdLike(String value) {
            this.addCriterion("RECORD_ID like", value, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdNotLike(String value) {
            this.addCriterion("RECORD_ID not like", value, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdIn(List<String> values) {
            this.addCriterion("RECORD_ID in", values, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdNotIn(List<String> values) {
            this.addCriterion("RECORD_ID not in", values, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdBetween(String value1, String value2) {
            this.addCriterion("RECORD_ID between", value1, value2, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecordIdNotBetween(String value1, String value2) {
            this.addCriterion("RECORD_ID not between", value1, value2, "recordId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdIsNull() {
            this.addCriterion("MSG_ID is null");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdIsNotNull() {
            this.addCriterion("MSG_ID is not null");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdEqualTo(String value) {
            this.addCriterion("MSG_ID =", value, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdNotEqualTo(String value) {
            this.addCriterion("MSG_ID <>", value, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdGreaterThan(String value) {
            this.addCriterion("MSG_ID >", value, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdGreaterThanOrEqualTo(String value) {
            this.addCriterion("MSG_ID >=", value, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdLessThan(String value) {
            this.addCriterion("MSG_ID <", value, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdLessThanOrEqualTo(String value) {
            this.addCriterion("MSG_ID <=", value, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdLike(String value) {
            this.addCriterion("MSG_ID like", value, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdNotLike(String value) {
            this.addCriterion("MSG_ID not like", value, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdIn(List<String> values) {
            this.addCriterion("MSG_ID in", values, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdNotIn(List<String> values) {
            this.addCriterion("MSG_ID not in", values, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdBetween(String value1, String value2) {
            this.addCriterion("MSG_ID between", value1, value2, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andMsgIdNotBetween(String value1, String value2) {
            this.addCriterion("MSG_ID not between", value1, value2, "msgId");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserIsNull() {
            this.addCriterion("REC_USER is null");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserIsNotNull() {
            this.addCriterion("REC_USER is not null");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserEqualTo(String value) {
            this.addCriterion("REC_USER =", value, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserNotEqualTo(String value) {
            this.addCriterion("REC_USER <>", value, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserGreaterThan(String value) {
            this.addCriterion("REC_USER >", value, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserGreaterThanOrEqualTo(String value) {
            this.addCriterion("REC_USER >=", value, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserLessThan(String value) {
            this.addCriterion("REC_USER <", value, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserLessThanOrEqualTo(String value) {
            this.addCriterion("REC_USER <=", value, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserLike(String value) {
            this.addCriterion("REC_USER like", value, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserNotLike(String value) {
            this.addCriterion("REC_USER not like", value, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserIn(List<String> values) {
            this.addCriterion("REC_USER in", values, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserNotIn(List<String> values) {
            this.addCriterion("REC_USER not in", values, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserBetween(String value1, String value2) {
            this.addCriterion("REC_USER between", value1, value2, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andRecUserNotBetween(String value1, String value2) {
            this.addCriterion("REC_USER not between", value1, value2, "recUser");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadIsNull() {
            this.addCriterion("IS_READ is null");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadIsNotNull() {
            this.addCriterion("IS_READ is not null");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadEqualTo(String value) {
            this.addCriterion("IS_READ =", value, "isRead");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadNotEqualTo(String value) {
            this.addCriterion("IS_READ <>", value, "isRead");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadGreaterThan(String value) {
            this.addCriterion("IS_READ >", value, "isRead");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadGreaterThanOrEqualTo(String value) {
            this.addCriterion("IS_READ >=", value, "isRead");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadLessThan(String value) {
            this.addCriterion("IS_READ <", value, "isRead");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadLessThanOrEqualTo(String value) {
            this.addCriterion("IS_READ <=", value, "isRead");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadLike(String value) {
            this.addCriterion("IS_READ like", value, "isRead");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadNotLike(String value) {
            this.addCriterion("IS_READ not like", value, "isRead");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadIn(List<String> values) {
            this.addCriterion("IS_READ in", values, "isRead");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadNotIn(List<String> values) {
            this.addCriterion("IS_READ not in", values, "isRead");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadBetween(String value1, String value2) {
            this.addCriterion("IS_READ between", value1, value2, "isRead");
            return (MessageRecordExample.Criteria)this;
        }

        public MessageRecordExample.Criteria andIsReadNotBetween(String value1, String value2) {
            this.addCriterion("IS_READ not between", value1, value2, "isRead");
            return (MessageRecordExample.Criteria)this;
        }
    }
}
